package web;

import service.MenuService;
import service.impl.MenuServiceImpl;
import utils.BeansFactory;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author buguniao
 * @version v1.0
 * @date 2019/6/15 16:30
 * @description TODO
 **/
@WebServlet( "/menuServlet")
public class MenuServlet extends BaseServlet {
    private MenuService menuService = (MenuService) BeansFactory.getBeans("menuService");
    public void findAllMenu(HttpServletRequest request,HttpServletResponse response) throws IOException {
//        MenuServiceImpl menuService = new MenuServiceImpl();
        String json = menuService.findAllMenu();
        System.out.println("json = " + json);
        response.getWriter().write(json);
    }
}